from django.conf.urls import url
from myadmin.views import index,users,type,goods

urlpatterns = [
	# 后台首页
    url(r'^$', index.index,name='myadmin_index'),

    # 后台管理员路由
    url(r'^login$', index.login,name='myadmin_login'),
    url(r'^dologin$', index.dologin,name='myadmin_dologin'),
    url(r'^logout$', index.logout,name='myadmin_logout'),
    url(r'^verify$', index.verify, name="myadmin_verify"),  # 验证码



    # 会员信息管理路由
    url(r'^users/([0-9]+)$', users.index,name='myadmin_users_index'),  # 浏览用户信息
    url(r'^users/add$', users.add,name='myadmin_users_add'),  # 加载添加信息页面
    url(r'^users/insert$', users.insert,name='myadmin_users_insert'),  # 执行添加信息
    url(r'^users/del/(?P<uid>[0-9]+)$', users.delete,name='myadmin_users_del'),  # 删除用户信息
    url(r'^users/edit/(?P<uid>[0-9]+)$', users.edit,name='myadmin_users_edit'),  # 加载编辑页面
    url(r'^users/update/(?P<uid>[0-9]+)$', users.update,name='myadmin_users_update'),  # 执行信息编辑
    url(r'^users/repassword/(?P<uid>[0-9]+)$', users.repassword,name='myadmin_users_repassword'),  # 加载更改密码页面
    url(r'^users/reset/(?P<uid>[0-9]+)$', users.reset,name='myadmin_users_reset'),  #执行密码更改

    # 商品类别管理页
    url(r'^type$', type.index,name='myadmin_type_index'),  # 浏览商品类别信息
    url(r'^type/add/(?P<tid>[0-9]+)$', type.add,name='myadmin_type_add'),  # 加载添加信息页面
    url(r'^type/insert$', type.insert,name='myadmin_type_insert'),  # 执行添加信息
    url(r'^type/del/(?P<tid>[0-9]+)$', type.delete,name='myadmin_type_del'),  # 删除商品类别信息
    url(r'^type/edit/(?P<tid>[0-9]+)$', type.edit,name='myadmin_type_edit'),  # 加载编辑页面
    url(r'^type/update/(?P<tid>[0-9]+)$', type.update,name='myadmin_type_update'),  # 执行信息编辑

    # 商品信息管理页
    url(r'^goods/([0-9]+)$', goods.index,name='myadmin_goods_index'),  # 浏览商品信息
    url(r'^goods/add/$', goods.add,name='myadmin_goods_add'),  # 加载添加信息页面
    url(r'^goods/insert$', goods.insert,name='myadmin_goods_insert'),  # 执行添加信息
    url(r'^goods/del/(?P<gid>[0-9]+)$', goods.delete,name='myadmin_goods_del'),  # 删除商品信息
    url(r'^goods/edit/(?P<gid>[0-9]+)$', goods.edit,name='myadmin_goods_edit'),  # 加载编辑页面
    url(r'^goods/update/(?P<gid>[0-9]+)$', goods.update,name='myadmin_goods_update'),  # 执行信息编辑
    url(r'^goods/ueditor/$', goods.ueditor,name='myadmin_goods_ueditor'),  #富文本编辑器
]
